import { _decorator, Color, Component, Node, Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Natural')
export class Natural extends Component {
    private cover: Sprite
    start() {
        this.cover = this.node.getChildByName('cover').getComponent(Sprite)
    }

    public updateCover(data) {
        switch (data.gid) {
            case 1:
                this.cover.color = Color.RED
                break
            case 2:
                this.cover.color = Color.GREEN
                break
            case 3:
                this.cover.color = Color.YELLOW
                break
            case 4:
                this.cover.color = Color.BLUE
                break
        }
    }
}


